// 导入Promise
import {
	request
} from '../../request/index.js'


wx - Page({
	data: {
		//轮播图数据
		swiperList: [],
		//导航数组
		cateList: [],
		//楼层数据
		floorList: []
	},
	onLoad: function(options) {
		this.getSwiperList();
		this.getCateList();
		this.getFloorList();
	},

	//获取轮播图数据
	async getSwiperList() {
		const res = await request({
			url: '/home/swiperdata'
		})

		this.setData({
			swiperList: res.data.message
		})

	},

	//获取导航数组
	async getCateList() {
		const res = await request({
			url: '/home/catitems'
		})

		this.setData({
			cateList: res.data.message
		})

	},

	//获取楼层数据
	async getFloorList() {
		const res = await request({
			url: '/home/floordata'
		})
		
		
		this.setData({
			floorList: res.data.message
		})

	}

})
